package OI_test;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class outputStream_test {
    public static void main(String[] args) throws IOException {
        //在构造方法里加一个true是打开续写的功能，不会给你清空后才添加
        try(OutputStream output = new FileOutputStream("study/src/user1.txt",true)){
            //换行输入：
            //Windows系统里，换行符号是\r\n
            output.write("Hello ".getBytes("UTF-8"));
            output.write("Word!".getBytes("UTF-8"));
        }//后面会自动给我们加一个关闭流的操作：close()
    }
}
